package com.yanqu.road.dataHelper.utils;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author wpj
 * @Date 2020/8/15
 */
public class FileUtil {
    public static List<String> getStringListFromFile(String fileName) {
        List<String> arrayList = new ArrayList<>();
        try {
            File file = new File(fileName);
            InputStreamReader inputReader = new InputStreamReader(new FileInputStream(file));
            BufferedReader bf = new BufferedReader(inputReader);
            // 按行读取字符串
            String str;
            while ((str = bf.readLine()) != null) {
                arrayList.add(str);
            }
            bf.close();
            inputReader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return arrayList;
    }
}
